View Issue Details

IDProjectCategoryView StatusLast Update
0001328K18X001.00 SKB SWANSWpublic2021-09-28 10:17
Reporter(ALTech) Sangmin Choi Assigned To(ALTech) Sangmin Choi Due Date2021-08-26 17:39
PriorityurgentSeveritys2-severeReproducibilityalways
Status closedResolutionfixed 
Summary0001328: There is a noise during NUGU audio play.
DescriptionThere is a noise during NUGU audio play.
("Aria" -> "Say something like ask weather" -> You can see the TTS play with noise")

When I set the audio option as "B tv", I can hear the noise.
And, when I set the audio option as "External device", I can't hear the noise.

But, there was no issue until 20210727 daily build.

After upgrade 20210728, this issue was happened.
I guess it's related with Karaoke function, I can see many commits related with Karaoke on 20210728 daily build.

The A113X firmware version is 0x21.

Could you please check this issue ASAP?
TagsNo tags attached.
Attach Tags

Relationships

related to 0001331 closed(ALTech) Lonnie Kim [SWAN]Audio drop issue during NUGU operating 

Users monitoring this issue

User List There are no users monitoring this issue.

Activities

(SW) Jacky Chiang

2021-08-24 17:18

manager   ~0007955

Hi Sita and River,

    Please check the commits in 20210728 and find which commit cause the noise and have solution on it.

(SW) River Wong

2021-09-01 14:44

developer   ~0008032

Hi Wooshin,

Let me correct the description. Current not any daily build has no problem with NUGU noise when under UHD or multiview.
It is the same issue as Synaptics Jira 165.
As Kail said that the issue is reproduced under UHD and multiview.
I guess the UHD is for IPTV. Because Youtube 4K content will be paused when using RCU NUGU.
Could you provide the UHD content(channel 73) for IPTV that can reproduce this issue? So, we can try to help to analyze the issue.

(SW) River Wong

2021-09-06 15:01

developer   ~0008078

Hi Wooshin,

We had a discussion with Synatpics on Synatpics Jira 165 about the NUGU noise issue.
I follow Synpatics's suggestion to change some code in vendor/synaptics/btv-hal-impl/synaptics/hal_av_pipeline.c
I test the modified code with Ch73 stream file(4K/AAC), it seems the result is good.
Could you help to test the following image to see if NUGU issue is fixed or not when playing multiview or UHD?
http://altserver01.iptime.org/release_by_fxn/swan_test_image/20210906_NuguNoiseFix/

If the image can fix the issue, please also try to give the following patch to SPtek to review.
Because I found SPtek always change code on this file (I think it is because Sptek is responsed for IPTV Player). I am not sure the modified code for case "if (PREPARE_PASSTHROUGH)" is right or not.
hal_av_pipeline.c.patch (4,867 bytes)   
diff --git a/hal_av_pipeline.c b/hal_av_pipeline.c
index 26dd709..cb2872f 100644
--- a/hal_av_pipeline.c
+++ b/hal_av_pipeline.c
@@ -192,10 +192,10 @@ int  AVP_Stop(AVP_HANDLE player) {
 	assert(ret == SUCCESS);
 	
 	amp_zapping_mgr_stop_service(player);
-	
-	if( !socPlayerInfo->playerConfig.keep_last_frame ) {
-       AMP_RPC(ret, AMP_DISP_Push_BuildInFrame, socPlayerInfo->amp_disp, socPlayerInfo->pip ? 1:0, 0);
-    }
+	
+	if( !socPlayerInfo->playerConfig.keep_last_frame ) {
+       AMP_RPC(ret, AMP_DISP_Push_BuildInFrame, socPlayerInfo->amp_disp, socPlayerInfo->pip ? 1:0, 0);
+    }
 	
 #ifdef AMP_LOG_WRITE_FILE
     if(logFp[socPlayerInfo->pip ? 1:0] != NULL)
@@ -493,7 +493,7 @@ int  AVP_SetAudioMute(AVP_HANDLE player, bool mute) {
 		if(oldMuteState != mute) {
 			//HRESULT ret = AMP_SND_SetMute(AMP_SND_PATH_71, ismute ? TRUE:FALSE);
 			//AMP_SND_SetMute(AMP_SND_PATH_HDMI, ismute ? TRUE:FALSE); //HDMI mute
-	
+			/*
 			ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel, mute ? TRUE:FALSE);
 			if (SUCCESS == ret)  {
 				ALOGD("++%s[%d]  %s audio\n", __FUNCTION__, socPlayerInfo->pip, mute ? "mute" : "unmute");
@@ -507,6 +507,55 @@ int  AVP_SetAudioMute(AVP_HANDLE player, bool mute) {
 				ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel3, mute ? TRUE:FALSE);
 				//assert(ret == SUCCESS);
 			}
+			*/
+			//Vas modified start; For fix NUGU TTS noise when play 4K content and multivie; River 2021/09/02
+			if(mute){
+				ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel, mute ? TRUE:FALSE);
+				if (SUCCESS == ret)  {
+					ALOGD("++%s[%d]  %s audio\n", __FUNCTION__, socPlayerInfo->pip, mute ? "mute" : "unmute");
+				} else ALOGD("++%s[%d]  failed to call AMP_SND_SetMute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret);
+
+				if (PREPARE_PASSTHROUGH) {
+					ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel2, mute ? TRUE:FALSE);
+					//assert(ret == SUCCESS);
+					ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel3, mute ? TRUE:FALSE);
+					//assert(ret == SUCCESS);
+				}
+
+				ALOGE("AMP_CLK_SetAVSyncOption set AMP_CLK_DROP");
+				AMP_RPC(ret, AMP_CLK_SetAVSyncOption, socPlayerInfo->amp_clk, 1, AMP_CLK_OPT_SYNC_OVERWRITE, 1, AMP_CLK_DROP, 0);
+				if (SUCCESS != ret)  { ALOGE("++%s[%d]  failed to call AMP_CLK_SetAVSyncOption 1 for mute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret); }
+				if (PREPARE_PASSTHROUGH) {
+					AMP_RPC(ret, AMP_CLK_SetAVSyncOption, socPlayerInfo->amp_clk, 2, AMP_CLK_OPT_SYNC_OVERWRITE, 1, AMP_CLK_DROP, 0);
+					if (SUCCESS != ret)  { ALOGE("++%s[%d]  failed to call AMP_CLK_SetAVSyncOption 2 for mute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret); }
+					AMP_RPC(ret, AMP_CLK_SetAVSyncOption, socPlayerInfo->amp_clk, 3, AMP_CLK_OPT_SYNC_OVERWRITE, 1, AMP_CLK_DROP, 0);
+					if (SUCCESS != ret)  { ALOGE("++%s[%d]  failed to call AMP_CLK_SetAVSyncOption 3 for mute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret); }
+				}
+			}
+			else{
+				ALOGE("AMP_CLK_SetAVSyncOption unset AMP_CLK_DROP");
+				AMP_RPC(ret, AMP_CLK_SetAVSyncOption, socPlayerInfo->amp_clk, 1, AMP_CLK_OPT_SYNC_OVERWRITE, 0, AMP_CLK_DROP, 0);
+				if (SUCCESS != ret)  { ALOGE("++%s[%d]  failed to call AMP_CLK_SetAVSyncOption 1 for unmute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret); }
+				if (PREPARE_PASSTHROUGH) {
+					AMP_RPC(ret, AMP_CLK_SetAVSyncOption, socPlayerInfo->amp_clk, 2, AMP_CLK_OPT_SYNC_OVERWRITE, 0, AMP_CLK_DROP, 0);
+					if (SUCCESS != ret)  { ALOGE("++%s[%d]  failed to call AMP_CLK_SetAVSyncOption 2 for unmute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret); }
+					AMP_RPC(ret, AMP_CLK_SetAVSyncOption, socPlayerInfo->amp_clk, 3, AMP_CLK_OPT_SYNC_OVERWRITE, 0, AMP_CLK_DROP, 0);
+					if (SUCCESS != ret)  { ALOGE("++%s[%d]  failed to call AMP_CLK_SetAVSyncOption 3 for unmute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret); }
+				}
+
+				ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel, mute ? TRUE:FALSE);
+				if (SUCCESS == ret)  {
+					ALOGD("++%s[%d]  %s audio\n", __FUNCTION__, socPlayerInfo->pip, mute ? "mute" : "unmute");
+				} else ALOGD("++%s[%d]  failed to call AMP_SND_SetMute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret);
+
+				if (PREPARE_PASSTHROUGH) {
+					ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel2, mute ? TRUE:FALSE);
+					//assert(ret == SUCCESS);
+					ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel3, mute ? TRUE:FALSE);
+					//assert(ret == SUCCESS);
+				}
+			}
+			//Vas modified end; River 2021/09/02
 	
 		} else ALOGD("++%s[%d]  already is mute %s", __FUNCTION__, socPlayerInfo->pip, mute ? "enable" : "disable");
 	} else ALOGD("++%s[%d]  failed to call AMP_SND_GetMute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret);
hal_av_pipeline.c.patch (4,867 bytes)   

(SW) River Wong

2021-09-06 16:09

developer   ~0008079

Hi Wooshin,

Because you said you still can hear NUGU TTS noise. could you help to get the audio dump when you hear NUGU TTS noise?
The step to enable audio dump:
1.Use the following commands to lower the volume to avoid too loud audio:
su
i2cset -f -y 0 0x2a 0x17 0x70 b
i2cset -f -y 0 0x2b 0x17 0x70 b
i2cset -f -y 0 0x2c 0x17 0x70 b
i2cset -f -y 0 0x2d 0x17 0x70 b
i2cset -f -y 0 0x2a 0x18 0x70 b
i2cset -f -y 0 0x2b 0x18 0x70 b
i2cset -f -y 0 0x2c 0x18 0x70 b
i2cset -f -y 0 0x2d 0x18 0x70 b
i2cdump -f -y 0 0x2a

2. Adjust BTV UI Volume to 25 and NUGU UI Volume to 27.
3. Enable audio dump by following commands:
setenforce 0
ampclient_alpha 28 -am 1

4. Try to reproduce NUGU TTS noise.
5. After you hear NUGU TTS noise, please pull a /data/AoutMultiIn0-xxx.bin file to me (xxx is a random number). I can check if there is any NUGU TTS noise.

(ALTech) Wooshin Kang

2021-09-06 16:21

developer   ~0008080

Please checked attached file.
AoutMultiIn0-3344.bin (43,417,600 bytes)

(SW) River Wong

2021-09-06 16:51

developer   ~0008081

Hi Wooshin,

From the AoutMultiIn0-3344.bin, I did not see any audio gap in NUGU TTS.
You can try to use audacity to import the file to play it again. (File->Import->Raw Data, Select Aout.bin file and refer to the following jpg for the import options) .

I think maybe you can try to ask SKT to modify to only play a 1kHz sine tone as NUGU TTS audio (no matter ask any question in NUGU), Then it will be easy to check it.
audacity_how_to_import_Aout.jpg (29,398 bytes)   
audacity_how_to_import_Aout.jpg (29,398 bytes)   

(ALTech) Wooshin Kang

2021-09-06 18:14

developer   ~0008083

Hi river,

1. Start Record
2. Stop recording when i hear an unnatural sound or noise
3. If i listen to the recorded data on a PC, i can hear it clearly

(SW) River Wong

2021-09-06 19:05

developer   ~0008084

Hi Wooshin,

Synaptics asks to enlarge audiohal push buffer . I build a test image in http://altserver01.iptime.org/release_by_fxn/swan_test_image/20210906_NuguEnlargePushThr
Please try it.

(SW) River Wong

2021-09-07 15:14

developer   ~0008097

Hi Wooshin,

The Nugu TTS noise fixes has two patches.
But I did not have permission to commit code into vendor/synaptics/btv-hal-impl/synaptics.
I attached one of the NUGU noise fix patch. Please have SPtek or Synpatics Tony to commit it.
0001-Fix-NUGU-TTS-noise-when-UHD-or-multiview-is-playing.patch (5,244 bytes)   
From 19dd4d9c43fcd2bfc1440e40ad641cc498d0ad02 Mon Sep 17 00:00:00 2001
From: river wong <river.wong@fii-foxconn.com>
Date: Tue, 7 Sep 2021 15:05:35 +0800
Subject: [PATCH] Fix NUGU TTS noise when UHD or multiview is playing. [1/2]

---
 hal_av_pipeline.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 54 insertions(+), 5 deletions(-)

diff --git a/hal_av_pipeline.c b/hal_av_pipeline.c
index 26dd709..cb2872f 100644
--- a/hal_av_pipeline.c
+++ b/hal_av_pipeline.c
@@ -192,10 +192,10 @@ int  AVP_Stop(AVP_HANDLE player) {
 	assert(ret == SUCCESS);
 	
 	amp_zapping_mgr_stop_service(player);
-	
-	if( !socPlayerInfo->playerConfig.keep_last_frame ) {
-       AMP_RPC(ret, AMP_DISP_Push_BuildInFrame, socPlayerInfo->amp_disp, socPlayerInfo->pip ? 1:0, 0);
-    }
+	
+	if( !socPlayerInfo->playerConfig.keep_last_frame ) {
+       AMP_RPC(ret, AMP_DISP_Push_BuildInFrame, socPlayerInfo->amp_disp, socPlayerInfo->pip ? 1:0, 0);
+    }
 	
 #ifdef AMP_LOG_WRITE_FILE
     if(logFp[socPlayerInfo->pip ? 1:0] != NULL)
@@ -493,7 +493,7 @@ int  AVP_SetAudioMute(AVP_HANDLE player, bool mute) {
 		if(oldMuteState != mute) {
 			//HRESULT ret = AMP_SND_SetMute(AMP_SND_PATH_71, ismute ? TRUE:FALSE);
 			//AMP_SND_SetMute(AMP_SND_PATH_HDMI, ismute ? TRUE:FALSE); //HDMI mute
-	
+			/*
 			ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel, mute ? TRUE:FALSE);
 			if (SUCCESS == ret)  {
 				ALOGD("++%s[%d]  %s audio\n", __FUNCTION__, socPlayerInfo->pip, mute ? "mute" : "unmute");
@@ -507,6 +507,55 @@ int  AVP_SetAudioMute(AVP_HANDLE player, bool mute) {
 				ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel3, mute ? TRUE:FALSE);
 				//assert(ret == SUCCESS);
 			}
+			*/
+			//Vas modified start; For fix NUGU TTS noise when play 4K content and multivie; River 2021/09/02
+			if(mute){
+				ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel, mute ? TRUE:FALSE);
+				if (SUCCESS == ret)  {
+					ALOGD("++%s[%d]  %s audio\n", __FUNCTION__, socPlayerInfo->pip, mute ? "mute" : "unmute");
+				} else ALOGD("++%s[%d]  failed to call AMP_SND_SetMute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret);
+
+				if (PREPARE_PASSTHROUGH) {
+					ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel2, mute ? TRUE:FALSE);
+					//assert(ret == SUCCESS);
+					ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel3, mute ? TRUE:FALSE);
+					//assert(ret == SUCCESS);
+				}
+
+				ALOGE("AMP_CLK_SetAVSyncOption set AMP_CLK_DROP");
+				AMP_RPC(ret, AMP_CLK_SetAVSyncOption, socPlayerInfo->amp_clk, 1, AMP_CLK_OPT_SYNC_OVERWRITE, 1, AMP_CLK_DROP, 0);
+				if (SUCCESS != ret)  { ALOGE("++%s[%d]  failed to call AMP_CLK_SetAVSyncOption 1 for mute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret); }
+				if (PREPARE_PASSTHROUGH) {
+					AMP_RPC(ret, AMP_CLK_SetAVSyncOption, socPlayerInfo->amp_clk, 2, AMP_CLK_OPT_SYNC_OVERWRITE, 1, AMP_CLK_DROP, 0);
+					if (SUCCESS != ret)  { ALOGE("++%s[%d]  failed to call AMP_CLK_SetAVSyncOption 2 for mute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret); }
+					AMP_RPC(ret, AMP_CLK_SetAVSyncOption, socPlayerInfo->amp_clk, 3, AMP_CLK_OPT_SYNC_OVERWRITE, 1, AMP_CLK_DROP, 0);
+					if (SUCCESS != ret)  { ALOGE("++%s[%d]  failed to call AMP_CLK_SetAVSyncOption 3 for mute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret); }
+				}
+			}
+			else{
+				ALOGE("AMP_CLK_SetAVSyncOption unset AMP_CLK_DROP");
+				AMP_RPC(ret, AMP_CLK_SetAVSyncOption, socPlayerInfo->amp_clk, 1, AMP_CLK_OPT_SYNC_OVERWRITE, 0, AMP_CLK_DROP, 0);
+				if (SUCCESS != ret)  { ALOGE("++%s[%d]  failed to call AMP_CLK_SetAVSyncOption 1 for unmute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret); }
+				if (PREPARE_PASSTHROUGH) {
+					AMP_RPC(ret, AMP_CLK_SetAVSyncOption, socPlayerInfo->amp_clk, 2, AMP_CLK_OPT_SYNC_OVERWRITE, 0, AMP_CLK_DROP, 0);
+					if (SUCCESS != ret)  { ALOGE("++%s[%d]  failed to call AMP_CLK_SetAVSyncOption 2 for unmute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret); }
+					AMP_RPC(ret, AMP_CLK_SetAVSyncOption, socPlayerInfo->amp_clk, 3, AMP_CLK_OPT_SYNC_OVERWRITE, 0, AMP_CLK_DROP, 0);
+					if (SUCCESS != ret)  { ALOGE("++%s[%d]  failed to call AMP_CLK_SetAVSyncOption 3 for unmute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret); }
+				}
+
+				ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel, mute ? TRUE:FALSE);
+				if (SUCCESS == ret)  {
+					ALOGD("++%s[%d]  %s audio\n", __FUNCTION__, socPlayerInfo->pip, mute ? "mute" : "unmute");
+				} else ALOGD("++%s[%d]  failed to call AMP_SND_SetMute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret);
+
+				if (PREPARE_PASSTHROUGH) {
+					ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel2, mute ? TRUE:FALSE);
+					//assert(ret == SUCCESS);
+					ret = AMP_SND_SetStreamMute((HANDLE)socPlayerInfo->amp_tunnel3, mute ? TRUE:FALSE);
+					//assert(ret == SUCCESS);
+				}
+			}
+			//Vas modified end; River 2021/09/02
 	
 		} else ALOGD("++%s[%d]  already is mute %s", __FUNCTION__, socPlayerInfo->pip, mute ? "enable" : "disable");
 	} else ALOGD("++%s[%d]  failed to call AMP_SND_GetMute, r = 0x%x", __FUNCTION__, socPlayerInfo->pip, ret);
-- 
2.7.4

(SW) River Wong

2021-09-07 17:53

developer   ~0008101

Synpatics patches are commited on 9/7.

(SW) River Wong

2021-09-09 14:26

developer   ~0008140

Update:

Since there is a side effect that play VOD will have audio delay 3~4 seconds after NUGU TTS end.
Remove the patch in vendor/synaptics/btv-hal-impl/synaptics (0001-Fix-NUGU-TTS-noise-when-UHD-or-multiview-is-playing.patch) can avoid this and also no NUGU TTS noise.

Issue History

Date Modified Username Field Change
2021-08-24 16:53 (ALTech) Sangmin Choi New Issue
2021-08-24 16:53 (ALTech) Sangmin Choi Status new => assigned
2021-08-24 16:53 (ALTech) Sangmin Choi Assigned To => (SW) Jacky Chiang
2021-08-24 17:16 (SW) Jacky Chiang Assigned To (SW) Jacky Chiang => (SW) Sita Huang
2021-08-24 17:18 (SW) Jacky Chiang Note Added: 0007955
2021-08-27 12:41 (SW) Jacky Chiang Relationship added related to 0001331
2021-08-27 12:41 (SW) Jacky Chiang Assigned To (SW) Sita Huang => (SW) Dean Chiang
2021-09-01 14:44 (SW) River Wong Note Added: 0008032
2021-09-02 08:33 (SW) Jacky Chiang Assigned To (SW) Dean Chiang => (SW) River Wong
2021-09-06 15:01 (SW) River Wong File Added: hal_av_pipeline.c.patch
2021-09-06 15:01 (SW) River Wong Note Added: 0008078
2021-09-06 16:09 (SW) River Wong Note Added: 0008079
2021-09-06 16:21 (ALTech) Wooshin Kang File Added: AoutMultiIn0-3344.bin
2021-09-06 16:21 (ALTech) Wooshin Kang Note Added: 0008080
2021-09-06 16:51 (SW) River Wong File Added: audacity_how_to_import_Aout.jpg
2021-09-06 16:51 (SW) River Wong Note Added: 0008081
2021-09-06 18:14 (ALTech) Wooshin Kang Note Added: 0008083
2021-09-06 19:05 (SW) River Wong Note Added: 0008084
2021-09-07 15:14 (SW) River Wong File Added: 0001-Fix-NUGU-TTS-noise-when-UHD-or-multiview-is-playing.patch
2021-09-07 15:14 (SW) River Wong Note Added: 0008097
2021-09-07 17:53 (SW) River Wong Status assigned => resolved
2021-09-07 17:53 (SW) River Wong Resolution open => fixed
2021-09-07 17:53 (SW) River Wong Note Added: 0008101
2021-09-07 17:54 (SW) River Wong Assigned To (SW) River Wong => (ALTech) Sangmin Choi
2021-09-09 14:26 (SW) River Wong Note Added: 0008140
2021-09-28 10:17 (ALTech) Wooshin Kang Status resolved => closed